package cc.rengu.igas.share.common.enums;

import cc.rengu.oltp.utility.util.StringUtil;

/**
 * 用户支付认证方式枚举
 * Created by 王成 on 2021/5/28.
 */
public enum UserPayAuthTypeEnum {
    NO_PASSWORD("00", "免密"),
    PASSWORD("01", "支付密码"),
    PASSWORD_SMS("02", "支付密码+短信验证码"),
    PASSWORD_UKEY("03", "支付密码+软UKEY"),
    ;
    private String type;
    private String desc;

    UserPayAuthTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static UserPayAuthTypeEnum getUserPayAuthType(String type) {
        for (UserPayAuthTypeEnum userPayAuthTypeEnum : UserPayAuthTypeEnum.values()) {
            if (!StringUtil.isEmptyOrNull(type) && type.equals(userPayAuthTypeEnum.getType())) {
                return userPayAuthTypeEnum;
            }
        }
        return null;
    }
}
